#ifndef BTFORM_H
#define BTFORM_H

#include <QWidget>
#include <QMouseEvent>
#include <QPropertyAnimation.h>

namespace Ui {
class BtForm;
}

class BtForm : public QWidget
{
    Q_OBJECT

public:
    explicit BtForm(QWidget *parent = nullptr);
    ~BtForm();

    //设置图标和文本和页面
    void setIconAndTextAndPage(const QString& icon,const QString& text,const int pageId);
    //返回页面id
    int getPageId() const;
    //清除按钮背景色
    void clearBackground() const;
    //设置按钮背景颜色
    void setBackground() const;
    //显示line动画
    void showAnimal() const;
    //关闭动画
    void hideAnimal() const;
protected:
    //重写点击事件
    void mousePressEvent(QMouseEvent* event);

signals:
    //点击信号
    void btFormClick(int);
private:
    Ui::BtForm *ui;
    int pageId;
    QPropertyAnimation *line1Animal;
    QPropertyAnimation *line2Animal;
    QPropertyAnimation *line3Animal;
    QPropertyAnimation *line4Animal;
};

#endif // BTFORM_H
